A voltage regulator maintains a constant output voltage regardless of changes in input voltage or load current. Almost every circuit needs one — from the tiny LDO on a coin battery Bluetooth module to the synchronous buck converters that power modern CPUs. Choosing between linear and switching comes down to efficiency, noise floor, required headroom, and how much heat you're willing to manage.
Linear vs. Switching Comparison
Property
Linear
Switching
How it works
Acts as variable series resistor, burns excess as heat
Switches inductor at high frequency, stores/releases energy efficiently
Inductor dominates size; overall smaller for high current
Speed
Fast transient response (µs)
Slower loop bandwidth (ms range)
For the same 5 V, 1 A load, a linear regulator fed from 12 V must discard 7 W as heat. A 90%-efficient buck converter draws only about 5.6 W, so roughly 0.6 W becomes heat. The switcher is more complex and noisier, but needs far less thermal management.
Linear Regulators
The regulator is a transistor in series with the load, controlled by an error amplifier that compares the output to a reference voltage and adjusts the transistor to compensate:
P_heat = (V_in − V_out) × I_load
Example: 9V in, 5V out, 500mA load
P = (9 − 5) × 0.5 = 2W → needs heatsink
Efficiency = 5/9 = 55.6%
At 12V in, 5V out, 1A load:
P = 7W → requires large heatsink
Efficiency = 5/12 = 41.7%
78xx / 79xx Fixed Output
Part
Vout
Polarity
Min Vin
Max Vin
Iout max
7805
5V
Positive
7V
35V
1A (TO-220), 100mA (TO-92)
7809
9V
Positive
11V
35V
1A
7812
12V
Positive
14V
35V
1A
7815
15V
Positive
17V
35V
1A
7905
−5V
Negative
−7V
−35V
1A
7912
−12V
Negative
−14V
−35V
1A
A standard 7805 circuit. The 100nF bypass capacitors are mandatory for stability — placed as close to the IC pins as possible.
100nF ceramics on both pins — required for stability
Add 10µF electrolytic on output for better transient response
The LM317 maintains a constant 1.25V between the OUT and ADJ pins. By selecting R1 and R2, this constant voltage drives a constant current through R2, setting the output voltage.
Classic 78xx devices need ~2V of headroom. LDOs work with much less — critical for battery-powered devices where the battery voltage drops as it discharges:
Part
Vout
Dropout
Iq (quiescent)
Notes
AMS1117-3.3
3.3V
1.1V
5 mA
Cheap, common on dev boards. High Iq — bad for battery.
LP2950-5
5V
40 mV
75 µA
Low noise, good for audio and RF reference
MCP1700-3302
3.3V
178 mV
1.6 µA
Ultra-low quiescent — ideal for battery/sleep devices
TLV1117-33
3.3V
1.1V
5 mA
TI version of AMS1117, interchangeable
XC6206P332
3.3V
200 mV @ 100mA
1 µA
SOT-23, tiny, very low Iq. Common in portable electronics.
LDO gotcha: some are unstable with low-ESR ceramics at the output. Check the datasheet for required output capacitor ESR range — older LDOs (LP2950 family) want 1–10Ω ESR, which means electrolytic or a series resistor with the ceramic.
Switching Regulators — Key ICs
Part
Type
Vin
Vout
Iout
Notes
LM2596
Buck
4–40V
1.2–37V adj.
3A
Simple, slow (150kHz). Large inductor needed. Good beginner switcher.
MP1584
Buck
4.5–28V
0.8–25V adj.
3A
Small, 1.5MHz. Popular in DFRobot/generic modules.
LM2576
Buck
7–40V
3.3/5/12/15/adj
3A
Fixed voltage versions available. 52kHz.
MT3608
Boost
2–24V
5–28V adj.
2A
Common hobby boost module. 1.2MHz, compact.
XL6009
Boost
3–32V
5–35V adj.
4A
Higher current boost, replaces MT3608 for heavier loads
TPS63020
Buck-boost
1.8–5.5V
1.2–5V adj.
2A
Texas Instruments, excellent for Li-ion battery applications
Heat and Heatsinking
Thermal resistance of TO-220 package (junction to case): θjc ≈ 5°C/W
Thermal resistance to ambient without heatsink: θja ≈ 50°C/W
Max junction temperature for 78xx: 125°C
Ambient: 25°C → max power dissipation without heatsink:
P_max = (125 − 25) / 50 = 2W
With heatsink (θja = 10°C/W):
P_max = 100 / 10 = 10W
Always check: T_junction = T_ambient + P × θja < T_max
Choosing the Right Regulator
Situation
Best choice
Why
5V from 9V wall adapter, 200mA
7805 linear
P = (9-5)×0.2 = 0.8W — no heatsink needed, simple, quiet
5V from 12V at 1A
Buck converter
P = 7W in a linear — too much heat. Switcher: ~95% efficiency, minimal heat
3.3V from 3.7V LiPo
LDO (MCP1700)
Small dropout (needed at end of charge cycle), ultra-low Iq for battery life